DEF_PROJECT=../../..
include $(DEF_PROJECT)/scripts/main.mk
name=shadow
version=4.1.5.1
prefix=/usr
destdir=$(DIR_SYSROOT)
extdeps=eglibc-tools gcc-tools binutils-tools linux-header-tools

DL_SERV=http
DL_HOST=pkg-shadow.alioth.debian.org
DL_PATH=releases
DL_SUFFIX=tar.bz2

cflags+=--host=$(CC_TARGET)
cflags+=--build=$(CC_HOST)
cflags+=--sysconfdir=/etc
cflags+=--without-libpam
cflags+=--without-audit
cflags+=--without-selinux
cflags+=--cache-file=$(DEF_CACHE)

pre-build:
	echo ac_cv_func_setpgrp_void=yes >$(source)/$(DEF_CACHE)
	cd $<;$(cdefs) ./configure $(cflags)
	sed 's/groups$$(EXEEXT) //' -i $(source)/src/Makefile

post-build:
	$(MAKE) -C $(if $(build),$(build),$(source)) $(iflags)
	sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' -e 's@/var/spool/mail@/var/mail@' -i $(destdir)/etc/login.defs
	mv -v $(destdir)/usr/bin/passwd $(destdir)/bin
